package org.wendu.wdoa.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.wendu.wdoa.model.Fun;

import java.util.List;

public interface HomeDao {



    public List<Fun> findUserFunList(String userId);


    void deleteUserId(String userId);

    @Select("select e_name from t_emp where e_id=#{userId}")
    String findEmpNameById(String userId);

    @Insert("insert into  t_user values (#{userId},#{userName},'123456')")
    void insertUser(String userId, String userName);

    @Select("select count(0) from t_user where u_id=#{userId}")
    int checkUser(String userId);

    @Select("select d_id from t_emp where e_id=#{userId}")
    int findDepId(String userId);

    @Select("select count(0) from t_mgr where d_id=#{d_id}")
    int checkDepp(int d_id);

    @Insert("insert into t_mgr value (#{mgrId},#{userId},#{d_id})")
    void insertMgrr(int mgrId,String userId, int d_id);

    @Select("select ifnull(max(mgr_id),0) from t_mgr")
    int findMixMgId();

    @Delete("delete from t_mgr where d_id=#{d_id}")
    void deleteMgr(int d_id);
}
